home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / QD3DTransform.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  11.0 KB  |  360 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2.  **                                                                             **
  3.  **     Module:        QD3DTransform.h                                             **
  4.  **                                                                          **
  5.  **                                                                          **
  6.  **     Purpose:     Transform routines                                          **
  7.  **                                                                          **
  8.  **                                                                          **
  9.  **                                                                          **
  10.  **     Copyright (C) 1991-1997 Apple Computer, Inc. All rights reserved.     **    
  11.  **                                                                          **
  12.  **                                                                          **
  13.  *****************************************************************************/
  14. #ifndef QD3DTransform_h
  15. #define QD3DTransform_h
  16.  
  17. #include "QD3D.h"
  18.  
  19. #if defined(PRAGMA_ONCE) && PRAGMA_ONCE
  20.     #pragma once
  21. #endif  /*  PRAGMA_ONCE  */
  22.  
  23. #if defined(OS_MACINTOSH) && OS_MACINTOSH
  24.  
  25. #if defined(__xlc__) || defined(__XLC121__)
  26.     #pragma options enum=int
  27.     #pragma options align=power
  28. #elif defined(__MWERKS__)
  29.     #pragma enumsalwaysint on
  30.     #pragma options align=native
  31. #elif defined(__MRC__) || defined(__SC__)
  32.     #if __option(pack_enums)
  33.         #define PRAGMA_ENUM_RESET_QD3DTRANS 1
  34.     #endif
  35.     #pragma options(!pack_enums)
  36.     #pragma options align=power
  37. #endif
  38.  
  39. #endif  /* OS_MACINTOSH */
  40.  
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif    /* __cplusplus */
  44.  
  45. /******************************************************************************
  46.  **                                                                             **
  47.  **                            Transform Routines                                 **
  48.  **                                                                             **
  49.  *****************************************************************************/
  50.  
  51. QD3D_EXPORT TQ3ObjectType QD3D_CALL Q3Transform_GetType(
  52.     TQ3TransformObject    transform);
  53.  
  54. QD3D_EXPORT TQ3Matrix4x4 *QD3D_CALL Q3Transform_GetMatrix(
  55.     TQ3TransformObject    transform,
  56.     TQ3Matrix4x4        *matrix);
  57.  
  58. QD3D_EXPORT TQ3Status QD3D_CALL Q3Transform_Submit(
  59.     TQ3TransformObject    transform, 
  60.     TQ3ViewObject        view);
  61.  
  62.  
  63. /******************************************************************************
  64.  **                                                                             **
  65.  **                            MatrixTransform Routines                         **
  66.  **                                                                             **
  67.  *****************************************************************************/
  68.  
  69. QD3D_EXPORT TQ3TransformObject QD3D_CALL Q3MatrixTransform_New(
  70.     const TQ3Matrix4x4     *matrix);
  71.  
  72. QD3D_EXPORT TQ3Status QD3D_CALL Q3MatrixTransform_Submit(
  73.     const TQ3Matrix4x4     *matrix,
  74.     TQ3ViewObject        view);
  75.  
  76. QD3D_EXPORT TQ3Status QD3D_CALL Q3MatrixTransform_Set(
  77.     TQ3TransformObject    transform, 
  78.     const TQ3Matrix4x4      *matrix);
  79.  
  80. QD3D_EXPORT TQ3Status QD3D_CALL Q3MatrixTransform_Get(
  81.     TQ3TransformObject    transform,
  82.     TQ3Matrix4x4        *matrix);
  83.  
  84.  
  85. /******************************************************************************
  86.  **                                                                             **
  87.  **                            RotateTransform Data                             **
  88.  **                                                                             **
  89.  *****************************************************************************/
  90.  
  91. typedef struct TQ3RotateTransformData {
  92.     TQ3Axis        axis;
  93.     float        radians;
  94. } TQ3RotateTransformData;
  95.  
  96.  
  97. /******************************************************************************
  98.  **                                                                             **
  99.  **                            RotateTransform Routines                         **
  100.  **                                                                             **
  101.  *****************************************************************************/
  102.  
  103. QD3D_EXPORT TQ3TransformObject QD3D_CALL Q3RotateTransform_New(
  104.     const TQ3RotateTransformData    *data);
  105.  
  106.  
  107. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateTransform_Submit(
  108.     const TQ3RotateTransformData    *data,
  109.     TQ3ViewObject                    view);
  110.  
  111. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateTransform_SetData(
  112.     TQ3TransformObject                transform,
  113.     const TQ3RotateTransformData    *data);
  114.  
  115. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateTransform_GetData(
  116.     TQ3TransformObject                transform,
  117.     TQ3RotateTransformData            *data);
  118.     
  119. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateTransform_SetAxis(
  120.     TQ3TransformObject                transform,
  121.     TQ3Axis                            axis);
  122.  
  123. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateTransform_SetAngle(
  124.     TQ3TransformObject                transform,
  125.     float                            radians);
  126.  
  127. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateTransform_GetAxis(
  128.     TQ3TransformObject                 renderable, 
  129.     TQ3Axis                         *axis);
  130.  
  131. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateTransform_GetAngle(
  132.     TQ3TransformObject                 transform, 
  133.     float                             *radians);
  134.  
  135.  
  136. /******************************************************************************
  137.  **                                                                             **
  138.  **                    RotateAboutPointTransform Data                             **
  139.  **                                                                             **
  140.  *****************************************************************************/
  141.  
  142. typedef struct TQ3RotateAboutPointTransformData {
  143.     TQ3Axis            axis;
  144.     float            radians;
  145.     TQ3Point3D        about;
  146. } TQ3RotateAboutPointTransformData;
  147.  
  148.  
  149. /******************************************************************************
  150.  **                                                                             **
  151.  **                    RotateAboutPointTransform Routines                         **
  152.  **                                                                             **
  153.  *****************************************************************************/
  154.  
  155. QD3D_EXPORT TQ3TransformObject QD3D_CALL Q3RotateAboutPointTransform_New(
  156.     const TQ3RotateAboutPointTransformData    *data);
  157.  
  158. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateAboutPointTransform_Submit(
  159.     const TQ3RotateAboutPointTransformData    *data,
  160.     TQ3ViewObject                            view);
  161.  
  162. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateAboutPointTransform_SetData(
  163.     TQ3TransformObject                        transform,
  164.     const TQ3RotateAboutPointTransformData    *data);
  165.  
  166. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateAboutPointTransform_GetData(
  167.     TQ3TransformObject                        transform,
  168.     TQ3RotateAboutPointTransformData        *data);
  169.  
  170. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateAboutPointTransform_SetAxis(
  171.     TQ3TransformObject                        transform,
  172.     TQ3Axis                                    axis);
  173.  
  174. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateAboutPointTransform_GetAxis(
  175.     TQ3TransformObject                        transform,
  176.     TQ3Axis                                    *axis);
  177.  
  178.  
  179. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateAboutPointTransform_SetAngle(
  180.     TQ3TransformObject                        transform,
  181.     float                                    radians);
  182.  
  183. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateAboutPointTransform_GetAngle(
  184.     TQ3TransformObject                        transform,
  185.     float                                    *radians);
  186.  
  187.  
  188. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateAboutPointTransform_SetAboutPoint(
  189.     TQ3TransformObject                        transform,
  190.     const TQ3Point3D                        *about);
  191.  
  192. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateAboutPointTransform_GetAboutPoint(
  193.     TQ3TransformObject                        transform,
  194.     TQ3Point3D                                *about);
  195.  
  196.  
  197. /******************************************************************************
  198.  **                                                                             **
  199.  **                    RotateAboutAxisTransform Data                             **
  200.  **                                                                             **
  201.  *****************************************************************************/
  202.  
  203. typedef struct TQ3RotateAboutAxisTransformData {
  204.     TQ3Point3D            origin;
  205.     TQ3Vector3D            orientation;
  206.     float                radians;
  207. } TQ3RotateAboutAxisTransformData;
  208.  
  209.  
  210. /******************************************************************************
  211.  **                                                                             **
  212.  **                    RotateAboutAxisTransform Routines                         **
  213.  **                                                                             **
  214.  *****************************************************************************/
  215.  
  216. QD3D_EXPORT TQ3TransformObject QD3D_CALL Q3RotateAboutAxisTransform_New(
  217.     const TQ3RotateAboutAxisTransformData    *data);
  218.  
  219. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateAboutAxisTransform_Submit(
  220.     const TQ3RotateAboutAxisTransformData    *data,
  221.     TQ3ViewObject                            view);
  222.  
  223. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateAboutAxisTransform_SetData(
  224.     TQ3TransformObject                        transform,
  225.     const TQ3RotateAboutAxisTransformData    *data);
  226.  
  227. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateAboutAxisTransform_GetData(
  228.     TQ3TransformObject                        transform,
  229.     TQ3RotateAboutAxisTransformData            *data);
  230.  
  231.  
  232. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateAboutAxisTransform_SetOrientation(
  233.     TQ3TransformObject                        transform,
  234.     const TQ3Vector3D                        *axis);
  235.  
  236. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateAboutAxisTransform_GetOrientation(
  237.     TQ3TransformObject                        transform,
  238.     TQ3Vector3D                                *axis);
  239.  
  240.  
  241. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateAboutAxisTransform_SetAngle(
  242.     TQ3TransformObject                        transform,
  243.     float                                    radians);
  244.  
  245. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateAboutAxisTransform_GetAngle(
  246.     TQ3TransformObject                        transform,
  247.     float                                    *radians);
  248.  
  249.  
  250. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateAboutAxisTransform_SetOrigin(
  251.     TQ3TransformObject                        transform,
  252.     const TQ3Point3D                            *origin);
  253.  
  254. QD3D_EXPORT TQ3Status QD3D_CALL Q3RotateAboutAxisTransform_GetOrigin(
  255.     TQ3TransformObject                        transform,
  256.     TQ3Point3D                                *origin);
  257.  
  258.  
  259. /******************************************************************************
  260.  **                                                                             **
  261.  **                            ScaleTransform Routines                             **
  262.  **                                                                             **
  263.  *****************************************************************************/
  264.  
  265. QD3D_EXPORT TQ3TransformObject QD3D_CALL Q3ScaleTransform_New(
  266.     const TQ3Vector3D        *scale);
  267.  
  268. QD3D_EXPORT TQ3Status QD3D_CALL Q3ScaleTransform_Submit(
  269.     const TQ3Vector3D        *scale,
  270.     TQ3ViewObject            view);
  271.         
  272. QD3D_EXPORT TQ3Status QD3D_CALL Q3ScaleTransform_Set(
  273.     TQ3TransformObject        transform,
  274.     const TQ3Vector3D        *scale);
  275.  
  276. QD3D_EXPORT TQ3Status QD3D_CALL Q3ScaleTransform_Get(
  277.     TQ3TransformObject        transform,
  278.     TQ3Vector3D                *scale);
  279.  
  280.  
  281. /******************************************************************************
  282.  **                                                                             **
  283.  **                            TranslateTransform Routines                         **
  284.  **                                                                             **
  285.  *****************************************************************************/
  286.  
  287. QD3D_EXPORT TQ3TransformObject QD3D_CALL Q3TranslateTransform_New(
  288.     const TQ3Vector3D        *translate);
  289.  
  290. QD3D_EXPORT TQ3Status QD3D_CALL Q3TranslateTransform_Submit(
  291.     const TQ3Vector3D        *translate,
  292.     TQ3ViewObject            view);
  293.  
  294. QD3D_EXPORT TQ3Status QD3D_CALL Q3TranslateTransform_Set(
  295.     TQ3TransformObject        transform,
  296.     const TQ3Vector3D        *translate);
  297.  
  298. QD3D_EXPORT TQ3Status QD3D_CALL Q3TranslateTransform_Get(
  299.     TQ3TransformObject        transform,
  300.     TQ3Vector3D                *translate);
  301.  
  302.  
  303. /******************************************************************************
  304.  **                                                                             **
  305.  **                            QuaternionTransform Routines                     **
  306.  **                                                                             **
  307.  *****************************************************************************/
  308.  
  309. QD3D_EXPORT TQ3TransformObject QD3D_CALL Q3QuaternionTransform_New(
  310.     const TQ3Quaternion        *quaternion);
  311.  
  312. QD3D_EXPORT TQ3Status QD3D_CALL Q3QuaternionTransform_Submit(
  313.     const TQ3Quaternion        *quaternion,
  314.     TQ3ViewObject            view);
  315.  
  316. QD3D_EXPORT TQ3Status QD3D_CALL Q3QuaternionTransform_Set(
  317.     TQ3TransformObject        transform, 
  318.     const TQ3Quaternion     *quaternion);
  319.  
  320. QD3D_EXPORT TQ3Status QD3D_CALL Q3QuaternionTransform_Get(
  321.     TQ3TransformObject        transform,
  322.     TQ3Quaternion            *quaternion);
  323.  
  324.  
  325. /******************************************************************************
  326.  **                                                                             **
  327.  **                            ResetTransform Routines                             **
  328.  **                                                                             **
  329.  *****************************************************************************/
  330.  
  331. QD3D_EXPORT TQ3TransformObject QD3D_CALL Q3ResetTransform_New(
  332.     void);
  333.  
  334. QD3D_EXPORT TQ3Status QD3D_CALL Q3ResetTransform_Submit(
  335.     TQ3ViewObject            view);
  336.  
  337. #ifdef __cplusplus
  338. }
  339. #endif    /* __cplusplus */
  340.  
  341. #if defined(OS_MACINTOSH) && OS_MACINTOSH
  342.  
  343. #if defined(__xlc__) || defined(__XLC121__)
  344.     #pragma options enum=reset
  345.     #pragma options align=reset
  346. #elif defined(__MWERKS__)
  347.     #pragma enumsalwaysint reset
  348.     #pragma options align=reset
  349. #elif defined(__MRC__) || defined(__SC__)
  350.     #if PRAGMA_ENUM_RESET_QD3DTRANS
  351.         #pragma options(pack_enums)
  352.         #undef PRAGMA_ENUM_RESET_QD3DTRANS
  353.     #endif
  354.     #pragma options align=reset
  355. #endif
  356.  
  357. #endif  /* OS_MACINTOSH */
  358.  
  359. #endif  /*  QD3DTransform_h  */
  360.